package org.community.front.controller;

import org.community.front.entity.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.servlet.ModelAndView;
import java.util.ArrayList;
import java.util.Collection;

@Controller
public class PageController {

    @GetMapping("/commit")
    public ModelAndView getCommit(ModelAndView modelAndView){
        modelAndView.setViewName("argument-test");
        Collection<User> users = new ArrayList<>();
        User user1 = new User("Amy","ageasd");
        User user2 = new User("Andy","agsd");
        User user3 = new User("zzz","sadsafafffffffffffffffffffffffffffffffffffffffffagasgaggggggggggggggggggggggggggagsagaaaaaaaaaaaaaaaaaaaaaa\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
        users.add(user1);
        users.add(user2);
        users.add(user3);
        modelAndView.addObject("users",users);
        return modelAndView;

    }


    //跳转至私人空间主页的方法
    @GetMapping("/private_space")
    public String toSpaceMean(){
        return "private-space-main";

    }


    //跳转至私人空间的留言页的方法
    @GetMapping("/private_space/message")
    public String toMessage(){
        return "private-space-message";

    }

    //跳转至私人空间相册页的方法
    @GetMapping("/private_space/picture")
    public String toPicture(){
        return "private-space-picture";

    }

    //跳转至私人空间相册页的方法
    @GetMapping("/private_space/video")
    public String toVideo(){
        return "private-space-video";

    }

}
